<!--
 * @description: 
 * @Author: jhw
 * @Date: 2023-09-09 19:35:27
 * @LastEditors: jhw
 * @LastEditTime: 2023-09-09 21:47:15
-->
<template>
  <div>
    <el-button type="primary" @click="handleClick">设置值</el-button>
    <el-button type="primary" @click="handleDraw">获取值</el-button>
    获取的值为：{{ msg }}
    <el-button @click="testRoute">测试store插件-router</el-button>
  </div>
</template>

<script setup lang="ts">
import { useIndexedDBStore, useRouterTestStore } from '@/store/index';
import { ref } from 'vue';

const msg = ref();
const file1 = { a: 'hello' };

const handleClick = () => {
  const indexedDBStore = useIndexedDBStore();
  indexedDBStore.setFilesDB('file1', file1);
};

const handleDraw = async () => {
  const indexedDBStore = useIndexedDBStore();

  msg.value = await indexedDBStore.getFilesDB('file1');
};

const testRoute = () => {
  const rouerTestStore = useRouterTestStore();
  console.log(rouerTestStore.getRoute().currentRoute);
};
</script>

<style scoped></style>
